package com.hundsun.documentripper.service.impl;

import com.hundsun.documentripper.domain.dto.DocumentTemplateRelationView;
import com.hundsun.documentripper.domain.pojo.DocumentTemplateRelation;
import com.hundsun.documentripper.mapper.DocumentTemplateRelationMapper;
import com.hundsun.documentripper.service.DocumentTemplateRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DocumentTemplateRelationServiceImpl implements DocumentTemplateRelationService {

    @Autowired
    private DocumentTemplateRelationMapper documentTemplateRelationMapper;

    @Override
    public List<DocumentTemplateRelationView> getAllDocumentTemplateRelationByCode(String code) {
        return documentTemplateRelationMapper.getAllDocumentTemplateRelationByCode(code);
    }

    @Override
    public void insertDocumentTemplateRelationBatch(List<DocumentTemplateRelation> documentTemplateRelationList) {
        documentTemplateRelationMapper.insertBatchSomeColumn(documentTemplateRelationList);
    }

    @Override
    public void deleteDocumentTemplateRelationByCode(String code) {
        documentTemplateRelationMapper.deleteAllByCode(code);
    }
}
